<!--
 * @Author: Wangtao
 * @Date: 2022-06-27 20:11:38
 * @LastEditors: Wangtao
 * @LastEditTime: 2022-09-08 19:38:49
-->
<template>
  <el-config-provider :locale="LOCALE">
    <router-view></router-view>
    <!--全局播放录音的audio-->
    <audio src="" style="display: none" id="mc_audio_hide" :autoplay="false"></audio>
  </el-config-provider>
</template>
<script lang="ts">
import { defineComponent, reactive, computed, onMounted } from 'vue'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import bus from '@/common/utils/bus'
export default defineComponent({
  name: 'App',
  components: {},
  setup() {
    const STATE = reactive({
      lang: 'zh-cn'
    })
    const LOCALE = computed(() => (STATE.lang === 'zh-cn' ? zhCn : zhCn))
    onMounted(() => {
      const audioNode = document.getElementById('mc_audio_hide')
      if (audioNode) {
        audioNode.onended = () => {
          bus.emit('restAudioStatus')
        }
      }
    })
    return { LOCALE }
  }
})
</script>

<style lang="stylus">
#nprogress .bar
  background: var(--el-color-primary) !important; //自定义颜色
</style>
